﻿<!DOCTYPE HTML>
<html>
{include file="public:header_css"}
<body>
<nav class="breadcrumb">
	<i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 广告管理 <span class="c-gray en">&gt;</span> 广告列表
	<a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a>
</nav>
<div class="page-container">
    <div class="cl pd-5 bg-1 bk-gray mt-20">
        <span class="r">共有数据：<strong>{$total}</strong> 条</span>
	</div>

	<div class="mt-20">
		<table class="table table-border table-bordered table-bg table-hover table-sort">
			<thead>
			<tr class="text-c">
				<!-- <th width="40"><input name="" type="checkbox" value=""></th> -->
				<th width="80">ID</th>
				<th width="100">图片</th>
				<th width="150">标题</th>
				<th width="150">超链接</th>
				<th width="150">有效期</th>
				<th width="100">操作</th>
			</tr>
			</thead>
			<tbody>
			{foreach name="list" item="v" key="k"}
			<tr class="text-c">
				<td>{$v.id}</td>
				<td><img width="80" class="picture-thumb" src="{$v.pic_url}"></td>
				<td class="text-l">{$v.title}</td>
				<td class="text-c">{$v.url}</td>
				<td class="text-c">{$v.start_time|date="Y-m-d",###} - {$v.end_time|date="Y-m-d",###}</td>
				<td class="td-manage">
					<span class="label label-success radius" onClick="del('{$v.id}',0)" href="javascript:;">恢复</span>
				</td>
			</tr>
			{/foreach}
			</tbody>
		</table>
	</div>

	{$page}

</div>

{include file="public:footer_js"}

<script type="text/javascript" src="__STATIC__/admin/lib/layer/2.4/layer.js"></script>

<script type="text/javascript">

	/**
	 * 删除
	 */
	function del(id)
	{
		var notice = "确认恢复吗？";

        layer.confirm(notice,function (index) {
            $.post(
                '{:url("edit")}?id='+id,
                {
                    is_del:0
                },
                function (res) {
                    if(res.code === 1){
                        layer.msg("恢复成功",{icon:6,time:1000});

                        // 两秒后跳转到列表页
                        setTimeout(function () {
                            location.replace(location.href);
                        },2000);

                    }else{
                        layer.msg(res.msg,{icon:5,time:1000});
                    }
                }
            );
        });
	}


</script>
</body>
</html>